/* 全局样式 */
:root {
    --primary-color: #1a73e8;
    --hover-color: #1557b0;
    --error-color: #dc3545;
    --success-color: #28a745;
    --background-color: #f8f9fa;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --skeleton-color: #e0e0e0;
    --skeleton-shine: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--background-color);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

/* 表单样式 */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transform: translateY(0);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.form-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.form-title {
    color: var(--primary-color);
    text-align: center;
    margin: 0 0 30px;
    font-size: 24px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all var(--transition-speed) ease;
    background-color: white;
}

.form-input:hover {
    border-color: var(--primary-color);
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
    outline: none;
}

.captcha-container {
    display: flex;
    gap: 10px;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    height: 38px;
    border-radius: 6px;
    cursor: pointer;
}

.form-button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.form-button:active {
    transform: scale(0.98);
}

.form-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.form-button:active::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

.form-button:hover {
    background-color: var(--hover-color);
}

.form-link {
    display: block;
    text-align: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    margin-top: 15px;
    transition: color 0.3s ease;
}

.form-link:hover {
    color: var(--hover-color);
}

/* 提示消息 */
.message {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 骨架屏动画 */
.skeleton {
    background: linear-gradient(90deg,
        var(--skeleton-color) 25%,
        var(--skeleton-shine) 50%,
        var(--skeleton-color) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.message.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.message.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* 管理员页面样式 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
}

.sidebar-title {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.menu-list {
    list-style: none;
}

.menu-item {
    margin-bottom: 10px;
}

.menu-link {
    display: block;
    padding: 10px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.menu-link:hover,
.menu-link.active {
    background-color: var(--hover-color);
}

.main-content {
    flex: 1;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.header-title {
    font-size: 24px;
    color: var(--primary-color);
}

.logout-button {
    padding: 8px 16px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #c82333;
}

/* 表格样式 */
.table-container {
    margin-top: 20px;
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #666;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background-color: #f8f9fa;
}

/* 表格按钮样式 */
.table-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    transition: opacity 0.3s ease;
    margin-right: 5px;
}

.table-button:last-child {
    margin-right: 0;
}

.table-button:hover {
    opacity: 0.8;
}

.table-button.edit {
    background-color: #2196F3;
}

.table-button.delete {
    background-color: var(--error-color);
}

.table-button.lock {
    background-color: #FF9800;
}

.table-button.unlock {
    background-color: var(--success-color);
}

.table-button.promote {
    background-color: #9C27B0;
}
